{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "vXe3iwJzPK-6"
      },
      "source": [
        "\n",
        "<div align=\"center\">\n",
        "  <img src=\"https://github.com/hitsz-ids/synthetic-data-generator/blob/main/assets/sdg_logo.png?raw=true\" width=\"400\" >\n",
        "</div>\n",
        "<div align=\"center\">"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "H-I6ZJ6cFwxx"
      },
      "source": [
        "\n",
        "\n",
        "\n",
        "\n",
        "# 🚀 Synthetic data generation without Raw Data using LLM\n",
        "\n",
        "\n",
        "\n",
        "\n",
        "The Synthetic Data Generator (SDG) is a specialized framework designed to generate high-quality structured tabular data. It incorporates a wide range of single-table, multi-table data synthesis algorithms and LLM-based synthetic data generation models.\n",
        "\n",
        "Synthetic data, generated by machines using real data, metadata, and algorithms, does not contain any sensitive information, yet it retains the essential characteristics of the original data. There is no direct correlation between synthetic data and real data, making it exempt from privacy regulations such as GDPR and ADPPA. This eliminates the risk of privacy breaches in practical applications."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "dmIUNuTlF2et",
        "outputId": "2f448158-b00d-4e53-a061-0bb662e87591"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Collecting git+https://github.com/hitsz-ids/synthetic-data-generator.git\n",
            "  Cloning https://github.com/hitsz-ids/synthetic-data-generator.git to /tmp/pip-req-build-3lmjup65\n",
            "  Running command git clone --filter=blob:none --quiet https://github.com/hitsz-ids/synthetic-data-generator.git /tmp/pip-req-build-3lmjup65\n",
            "  Resolved https://github.com/hitsz-ids/synthetic-data-generator.git to commit 54ee09b185ee33d5d7027f456c1bd263c8e571d8\n",
            "  Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n",
            "  Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n",
            "  Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
            "Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (8.1.7)\n",
            "Requirement already satisfied: cloudpickle in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (2.2.1)\n",
            "Collecting faker>=10 (from sdgx==0.1.6.dev0)\n",
            "  Downloading Faker-23.2.1-py3-none-any.whl (1.7 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.7/1.7 MB\u001b[0m \u001b[31m13.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: importlib-metadata in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (7.0.1)\n",
            "Collecting loguru (from sdgx==0.1.6.dev0)\n",
            "  Downloading loguru-0.7.2-py3-none-any.whl (62 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.5/62.5 kB\u001b[0m \u001b[31m5.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: matplotlib in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (3.7.1)\n",
            "Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (1.25.2)\n",
            "Collecting openai>=1.10.0 (from sdgx==0.1.6.dev0)\n",
            "  Downloading openai-1.12.0-py3-none-any.whl (226 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m226.7/226.7 kB\u001b[0m \u001b[31m20.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (1.5.3)\n",
            "Requirement already satisfied: pluggy in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (1.4.0)\n",
            "Requirement already satisfied: pyarrow in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (14.0.2)\n",
            "Requirement already satisfied: pydantic>=2 in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (2.6.1)\n",
            "Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (6.0.1)\n",
            "Requirement already satisfied: scikit-learn<2,>=0.24 in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (1.2.2)\n",
            "Requirement already satisfied: scipy in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (1.11.4)\n",
            "Collecting table-evaluator (from sdgx==0.1.6.dev0)\n",
            "  Downloading table_evaluator-1.6.1-py3-none-any.whl (22 kB)\n",
            "Requirement already satisfied: torch>=2 in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (2.1.0+cu121)\n",
            "Requirement already satisfied: torchvision in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (0.16.0+cu121)\n",
            "Requirement already satisfied: python-dateutil>=2.4 in /usr/local/lib/python3.10/dist-packages (from faker>=10->sdgx==0.1.6.dev0) (2.8.2)\n",
            "Requirement already satisfied: anyio<5,>=3.5.0 in /usr/local/lib/python3.10/dist-packages (from openai>=1.10.0->sdgx==0.1.6.dev0) (3.7.1)\n",
            "Requirement already satisfied: distro<2,>=1.7.0 in /usr/lib/python3/dist-packages (from openai>=1.10.0->sdgx==0.1.6.dev0) (1.7.0)\n",
            "Collecting httpx<1,>=0.23.0 (from openai>=1.10.0->sdgx==0.1.6.dev0)\n",
            "  Downloading httpx-0.27.0-py3-none-any.whl (75 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.6/75.6 kB\u001b[0m \u001b[31m9.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from openai>=1.10.0->sdgx==0.1.6.dev0) (1.3.0)\n",
            "Requirement already satisfied: tqdm>4 in /usr/local/lib/python3.10/dist-packages (from openai>=1.10.0->sdgx==0.1.6.dev0) (4.66.2)\n",
            "Requirement already satisfied: typing-extensions<5,>=4.7 in /usr/local/lib/python3.10/dist-packages (from openai>=1.10.0->sdgx==0.1.6.dev0) (4.9.0)\n",
            "Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic>=2->sdgx==0.1.6.dev0) (0.6.0)\n",
            "Requirement already satisfied: pydantic-core==2.16.2 in /usr/local/lib/python3.10/dist-packages (from pydantic>=2->sdgx==0.1.6.dev0) (2.16.2)\n",
            "Requirement already satisfied: joblib>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from scikit-learn<2,>=0.24->sdgx==0.1.6.dev0) (1.3.2)\n",
            "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn<2,>=0.24->sdgx==0.1.6.dev0) (3.3.0)\n",
            "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (3.13.1)\n",
            "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (1.12)\n",
            "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (3.2.1)\n",
            "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (3.1.3)\n",
            "Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (2023.6.0)\n",
            "Requirement already satisfied: triton==2.1.0 in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (2.1.0)\n",
            "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.10/dist-packages (from importlib-metadata->sdgx==0.1.6.dev0) (3.17.0)\n",
            "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (1.2.0)\n",
            "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (0.12.1)\n",
            "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (4.49.0)\n",
            "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (1.4.5)\n",
            "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (23.2)\n",
            "Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (9.4.0)\n",
            "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (3.1.1)\n",
            "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->sdgx==0.1.6.dev0) (2023.4)\n",
            "Collecting pandas (from sdgx==0.1.6.dev0)\n",
            "  Downloading pandas-2.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.3/12.3 MB\u001b[0m \u001b[31m75.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from table-evaluator->sdgx==0.1.6.dev0) (5.9.5)\n",
            "Collecting dython==0.7.3 (from table-evaluator->sdgx==0.1.6.dev0)\n",
            "  Downloading dython-0.7.3-py3-none-any.whl (23 kB)\n",
            "Requirement already satisfied: seaborn in /usr/local/lib/python3.10/dist-packages (from table-evaluator->sdgx==0.1.6.dev0) (0.13.1)\n",
            "Collecting tzdata>=2022.1 (from pandas->sdgx==0.1.6.dev0)\n",
            "  Downloading tzdata-2024.1-py2.py3-none-any.whl (345 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m345.4/345.4 kB\u001b[0m \u001b[31m23.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting scikit-plot>=0.3.7 (from dython==0.7.3->table-evaluator->sdgx==0.1.6.dev0)\n",
            "  Downloading scikit_plot-0.3.7-py3-none-any.whl (33 kB)\n",
            "Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from torchvision->sdgx==0.1.6.dev0) (2.31.0)\n",
            "Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.10/dist-packages (from anyio<5,>=3.5.0->openai>=1.10.0->sdgx==0.1.6.dev0) (3.6)\n",
            "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<5,>=3.5.0->openai>=1.10.0->sdgx==0.1.6.dev0) (1.2.0)\n",
            "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx<1,>=0.23.0->openai>=1.10.0->sdgx==0.1.6.dev0) (2024.2.2)\n",
            "Collecting httpcore==1.* (from httpx<1,>=0.23.0->openai>=1.10.0->sdgx==0.1.6.dev0)\n",
            "  Downloading httpcore-1.0.4-py3-none-any.whl (77 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.8/77.8 kB\u001b[0m \u001b[31m9.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting h11<0.15,>=0.13 (from httpcore==1.*->httpx<1,>=0.23.0->openai>=1.10.0->sdgx==0.1.6.dev0)\n",
            "  Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.4->faker>=10->sdgx==0.1.6.dev0) (1.16.0)\n",
            "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=2->sdgx==0.1.6.dev0) (2.1.5)\n",
            "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->torchvision->sdgx==0.1.6.dev0) (3.3.2)\n",
            "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->torchvision->sdgx==0.1.6.dev0) (2.0.7)\n",
            "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=2->sdgx==0.1.6.dev0) (1.3.0)\n",
            "Building wheels for collected packages: sdgx\n",
            "  Building wheel for sdgx (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for sdgx: filename=sdgx-0.1.6.dev0-py3-none-any.whl size=216340 sha256=c75711a6da80c72d5cfcdf3569ad74071e0f2d3af2fa397dfba4ee86b261a5cc\n",
            "  Stored in directory: /tmp/pip-ephem-wheel-cache-ty4xpfyx/wheels/a3/7c/29/b6529b1098dfaed856ca7c2c6dfd0113422a7a8f29d63c6a5c\n",
            "Successfully built sdgx\n",
            "Installing collected packages: tzdata, loguru, h11, pandas, httpcore, faker, scikit-plot, httpx, openai, dython, table-evaluator, sdgx\n",
            "  Attempting uninstall: pandas\n",
            "    Found existing installation: pandas 1.5.3\n",
            "    Uninstalling pandas-1.5.3:\n",
            "      Successfully uninstalled pandas-1.5.3\n",
            "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
            "google-colab 1.0.0 requires pandas==1.5.3, but you have pandas 2.0.3 which is incompatible.\u001b[0m\u001b[31m\n",
            "\u001b[0mSuccessfully installed dython-0.7.3 faker-23.2.1 h11-0.14.0 httpcore-1.0.4 httpx-0.27.0 loguru-0.7.2 openai-1.12.0 pandas-2.0.3 scikit-plot-0.3.7 sdgx-0.1.6.dev0 table-evaluator-1.6.1 tzdata-2024.1\n"
          ]
        }
      ],
      "source": [
        "# install dependencies\n",
        "# !pip install sdgx\n",
        "# OR\n",
        "!pip install git+https://github.com/hitsz-ids/synthetic-data-generator.git"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "BKSWvnJgF3h7"
      },
      "source": [
        "We demonstrate with a single table synthetic example.\n",
        "\n",
        "# LLM-integrated synthetic data generation\n",
        "\n",
        "For a long time, LLM has been used to understand and generate various types of data.\n",
        "\n",
        "In fact, LLM also has certain capabilities in tabular data generation. LLM has some abilities that cannot be achieved by traditional (GAN-based models or statistical models) .\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {
        "id": "o_mw9FeNPTcb"
      },
      "outputs": [],
      "source": [
        "# please set your openAI key here:\n",
        "\n",
        "OPEN_AI_KEY = \"\"\n",
        "OPEN_AI_BASE = \"https://api.openai.com/v1/\""
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "QLTmGyofF3V8",
        "outputId": "597a6c1f-b277-4d3a-d026-c281b4ed4c0a"
      },
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "\u001b[32m2024-02-27 09:35:33.841\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.utils\u001b[0m:\u001b[36mdownload_demo_data\u001b[0m:\u001b[36m68\u001b[0m - \u001b[1mDownloading demo data from github data source to /content/dataset/adult.csv\u001b[0m\n"
          ]
        }
      ],
      "source": [
        "# import packages\n",
        "\n",
        "import pandas as pd\n",
        "from sdgx.utils import download_demo_data\n",
        "from sdgx.data_models.metadata import Metadata\n",
        "from sdgx.models.LLM.single_table.gpt import SingleTableGPTModel\n",
        "\n",
        "# read the demo data\n",
        "# currently we use the well-known adult dataset as a example\n",
        "data_path = download_demo_data()\n",
        "df = pd.read_csv(data_path)\n",
        "metadata = Metadata.from_dataframe(df)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "TAbHCsEXJcfZ"
      },
      "source": [
        "\n",
        "# Synthetic data generation without Data\n",
        "\n",
        "\n",
        "Our `sdgx.models.LLM.single_table.gpt.SingleTableGPTModel` implements “Synthetic data generation without Raw Data”.\n",
        "\n",
        "No training data is required, synthetic data can be generated based on metadata data.\n",
        "\n",
        "![LLM_Case_1](https://github.com/hitsz-ids/synthetic-data-generator/blob/main/assets/LLM_Case_2.gif?raw=true)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "id": "e9cJ79xdVqek"
      },
      "outputs": [],
      "source": [
        "model = SingleTableGPTModel()\n",
        "model.set_openAI_settings(OPEN_AI_BASE, OPEN_AI_KEY)\n",
        "model.gpt_model = \"gpt-3.5-turbo\""
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "MlnE68SvOKb0",
        "outputId": "55400f85-8366-4301-803e-4a6533d04cfa"
      },
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "\u001b[32m2024-02-27 09:35:46.877\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36m_fit_with_metadata\u001b[0m:\u001b[36m228\u001b[0m - \u001b[1mFitting model with metadata...\u001b[0m\n",
            "\u001b[32m2024-02-27 09:35:46.888\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36m_fit_with_metadata\u001b[0m:\u001b[36m232\u001b[0m - \u001b[1mFitting model with metadata... Finished.\u001b[0m\n",
            "\u001b[32m2024-02-27 09:35:46.896\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36msample\u001b[0m:\u001b[36m385\u001b[0m - \u001b[1mSampling use GPT model ...\u001b[0m\n",
            "\u001b[32m2024-02-27 09:35:46.899\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36m_sample_with_metadata\u001b[0m:\u001b[36m446\u001b[0m - \u001b[1mSampling with metadata.\u001b[0m\n",
            "\u001b[32m2024-02-27 09:35:46.909\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.base\u001b[0m:\u001b[36m_form_dataset_description\u001b[0m:\u001b[36m122\u001b[0m - \u001b[1mNo dataset_description given in current model.\u001b[0m\n",
            "\u001b[32m2024-02-27 09:35:46.911\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.base\u001b[0m:\u001b[36m_form_message_with_offtable_features\u001b[0m:\u001b[36m108\u001b[0m - \u001b[1mNo off_table_feature needed in current model.\u001b[0m\n",
            "\u001b[32m2024-02-27 09:35:47.026\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36mask_gpt\u001b[0m:\u001b[36m163\u001b[0m - \u001b[1mAsk GPT with temperature = 0.1.\u001b[0m\n",
            "\u001b[32m2024-02-27 09:36:32.577\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36mask_gpt\u001b[0m:\u001b[36m176\u001b[0m - \u001b[1mAsk GPT Finished.\u001b[0m\n",
            "\u001b[32m2024-02-27 09:36:32.582\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36mextract_samples_from_response\u001b[0m:\u001b[36m357\u001b[0m - \u001b[1mExtracting samples from response ...\u001b[0m\n",
            "\u001b[32m2024-02-27 09:36:32.593\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36mextract_samples_from_response\u001b[0m:\u001b[36m369\u001b[0m - \u001b[1mExtracting samples from response ... Finished, 30 extracted.\u001b[0m\n",
            "\u001b[32m2024-02-27 09:36:32.596\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36msample\u001b[0m:\u001b[36m395\u001b[0m - \u001b[1mSampling use GPT model ... Finished.\u001b[0m\n"
          ]
        },
        {
          "data": {
            "application/vnd.google.colaboratory.intrinsic+json": {
              "summary": "{\n  \"name\": \"model\",\n  \"rows\": 30,\n  \"fields\": [\n    {\n      \"column\": \"capital-loss\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"0\",\n          \"500\",\n          \"2000\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"educational-num\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 7,\n        \"samples\": [\n          \"12\",\n          \"10\",\n          \"13\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"workclass\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"Self-emp-not-inc\",\n          \"Federal-gov\",\n          \"State-gov\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"fnlwgt\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 30,\n        \"samples\": [\n          \"320000\",\n          \"200000\",\n          \"280000\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"hours-per-week\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 6,\n        \"samples\": [\n          \"40\",\n          \"45\",\n          \"60\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"capital-gain\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"0\",\n          \"3000\",\n          \"5000\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"gender\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"Female\",\n          \"Male\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"age\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 25,\n        \"samples\": [\n          \"55\",\n          \"47\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"race\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 3,\n        \"samples\": [\n          \"White\",\n          \"Black\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"marital-status\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          \"Never-married\",\n          \"Separated\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"education\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 7,\n        \"samples\": [\n          \"Bachelors\",\n          \"HS-grad\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"income\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"<=50K\",\n          \">50K\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"native-country\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"China\",\n          \"Japan\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"occupation\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 7,\n        \"samples\": [\n          \"Sales\",\n          \"Tech-support\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"relationship\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"Not-in-family\",\n          \"Own-child\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}",
              "type": "dataframe"
            },
            "text/html": [
              "\n",
              "  <div id=\"df-8e4987c1-cf43-4e0c-b56b-2bc4d5948f3a\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>capital-loss</th>\n",
              "      <th>educational-num</th>\n",
              "      <th>workclass</th>\n",
              "      <th>fnlwgt</th>\n",
              "      <th>hours-per-week</th>\n",
              "      <th>capital-gain</th>\n",
              "      <th>gender</th>\n",
              "      <th>age</th>\n",
              "      <th>race</th>\n",
              "      <th>marital-status</th>\n",
              "      <th>education</th>\n",
              "      <th>income</th>\n",
              "      <th>native-country</th>\n",
              "      <th>occupation</th>\n",
              "      <th>relationship</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1500</td>\n",
              "      <td>12</td>\n",
              "      <td>Private</td>\n",
              "      <td>50000</td>\n",
              "      <td>40</td>\n",
              "      <td>2000</td>\n",
              "      <td>Male</td>\n",
              "      <td>35</td>\n",
              "      <td>White</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Sales</td>\n",
              "      <td>Husband</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>0</td>\n",
              "      <td>10</td>\n",
              "      <td>Self-emp-not-inc</td>\n",
              "      <td>60000</td>\n",
              "      <td>45</td>\n",
              "      <td>0</td>\n",
              "      <td>Female</td>\n",
              "      <td>28</td>\n",
              "      <td>Black</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Tech-support</td>\n",
              "      <td>Not-in-family</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>2000</td>\n",
              "      <td>8</td>\n",
              "      <td>State-gov</td>\n",
              "      <td>70000</td>\n",
              "      <td>35</td>\n",
              "      <td>0</td>\n",
              "      <td>Male</td>\n",
              "      <td>45</td>\n",
              "      <td>Asian-Pac-Islander</td>\n",
              "      <td>Divorced</td>\n",
              "      <td>11th</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>China</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Unmarried</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>0</td>\n",
              "      <td>14</td>\n",
              "      <td>Private</td>\n",
              "      <td>80000</td>\n",
              "      <td>50</td>\n",
              "      <td>5000</td>\n",
              "      <td>Female</td>\n",
              "      <td>40</td>\n",
              "      <td>White</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>Masters</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Canada</td>\n",
              "      <td>Prof-specialty</td>\n",
              "      <td>Wife</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>1000</td>\n",
              "      <td>9</td>\n",
              "      <td>Self-emp-inc</td>\n",
              "      <td>90000</td>\n",
              "      <td>55</td>\n",
              "      <td>10000</td>\n",
              "      <td>Male</td>\n",
              "      <td>50</td>\n",
              "      <td>Black</td>\n",
              "      <td>Separated</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Mexico</td>\n",
              "      <td>Craft-repair</td>\n",
              "      <td>Own-child</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>500</td>\n",
              "      <td>13</td>\n",
              "      <td>Federal-gov</td>\n",
              "      <td>100000</td>\n",
              "      <td>60</td>\n",
              "      <td>3000</td>\n",
              "      <td>Female</td>\n",
              "      <td>30</td>\n",
              "      <td>White</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>Assoc-acdm</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Adm-clerical</td>\n",
              "      <td>Unmarried</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>0</td>\n",
              "      <td>11</td>\n",
              "      <td>Private</td>\n",
              "      <td>110000</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Male</td>\n",
              "      <td>38</td>\n",
              "      <td>Black</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>Assoc-voc</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Protective-serv</td>\n",
              "      <td>Husband</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>1500</td>\n",
              "      <td>12</td>\n",
              "      <td>Private</td>\n",
              "      <td>120000</td>\n",
              "      <td>45</td>\n",
              "      <td>2000</td>\n",
              "      <td>Female</td>\n",
              "      <td>25</td>\n",
              "      <td>Asian-Pac-Islander</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Japan</td>\n",
              "      <td>Sales</td>\n",
              "      <td>Wife</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>2000</td>\n",
              "      <td>8</td>\n",
              "      <td>State-gov</td>\n",
              "      <td>130000</td>\n",
              "      <td>35</td>\n",
              "      <td>0</td>\n",
              "      <td>Male</td>\n",
              "      <td>55</td>\n",
              "      <td>White</td>\n",
              "      <td>Divorced</td>\n",
              "      <td>11th</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Tech-support</td>\n",
              "      <td>Not-in-family</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>0</td>\n",
              "      <td>10</td>\n",
              "      <td>Private</td>\n",
              "      <td>140000</td>\n",
              "      <td>50</td>\n",
              "      <td>5000</td>\n",
              "      <td>Female</td>\n",
              "      <td>42</td>\n",
              "      <td>Black</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Unmarried</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>1000</td>\n",
              "      <td>9</td>\n",
              "      <td>Self-emp-inc</td>\n",
              "      <td>150000</td>\n",
              "      <td>55</td>\n",
              "      <td>10000</td>\n",
              "      <td>Male</td>\n",
              "      <td>48</td>\n",
              "      <td>White</td>\n",
              "      <td>Separated</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Canada</td>\n",
              "      <td>Craft-repair</td>\n",
              "      <td>Own-child</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>500</td>\n",
              "      <td>13</td>\n",
              "      <td>Federal-gov</td>\n",
              "      <td>160000</td>\n",
              "      <td>60</td>\n",
              "      <td>3000</td>\n",
              "      <td>Female</td>\n",
              "      <td>32</td>\n",
              "      <td>Asian-Pac-Islander</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>Assoc-acdm</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Mexico</td>\n",
              "      <td>Adm-clerical</td>\n",
              "      <td>Unmarried</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>0</td>\n",
              "      <td>11</td>\n",
              "      <td>Private</td>\n",
              "      <td>170000</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Male</td>\n",
              "      <td>36</td>\n",
              "      <td>Black</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>Assoc-voc</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Protective-serv</td>\n",
              "      <td>Husband</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>1500</td>\n",
              "      <td>12</td>\n",
              "      <td>Private</td>\n",
              "      <td>180000</td>\n",
              "      <td>45</td>\n",
              "      <td>2000</td>\n",
              "      <td>Female</td>\n",
              "      <td>27</td>\n",
              "      <td>White</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Japan</td>\n",
              "      <td>Sales</td>\n",
              "      <td>Wife</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>2000</td>\n",
              "      <td>8</td>\n",
              "      <td>State-gov</td>\n",
              "      <td>190000</td>\n",
              "      <td>35</td>\n",
              "      <td>0</td>\n",
              "      <td>Male</td>\n",
              "      <td>52</td>\n",
              "      <td>Black</td>\n",
              "      <td>Divorced</td>\n",
              "      <td>11th</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Tech-support</td>\n",
              "      <td>Not-in-family</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>0</td>\n",
              "      <td>10</td>\n",
              "      <td>Private</td>\n",
              "      <td>200000</td>\n",
              "      <td>50</td>\n",
              "      <td>5000</td>\n",
              "      <td>Female</td>\n",
              "      <td>44</td>\n",
              "      <td>Asian-Pac-Islander</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Unmarried</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>1000</td>\n",
              "      <td>9</td>\n",
              "      <td>Self-emp-inc</td>\n",
              "      <td>210000</td>\n",
              "      <td>55</td>\n",
              "      <td>10000</td>\n",
              "      <td>Male</td>\n",
              "      <td>47</td>\n",
              "      <td>White</td>\n",
              "      <td>Separated</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Canada</td>\n",
              "      <td>Craft-repair</td>\n",
              "      <td>Own-child</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>500</td>\n",
              "      <td>13</td>\n",
              "      <td>Federal-gov</td>\n",
              "      <td>220000</td>\n",
              "      <td>60</td>\n",
              "      <td>3000</td>\n",
              "      <td>Female</td>\n",
              "      <td>34</td>\n",
              "      <td>Black</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>Assoc-acdm</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Mexico</td>\n",
              "      <td>Adm-clerical</td>\n",
              "      <td>Unmarried</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>0</td>\n",
              "      <td>11</td>\n",
              "      <td>Private</td>\n",
              "      <td>230000</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Male</td>\n",
              "      <td>34</td>\n",
              "      <td>White</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>Assoc-voc</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Protective-serv</td>\n",
              "      <td>Husband</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>1500</td>\n",
              "      <td>12</td>\n",
              "      <td>Private</td>\n",
              "      <td>240000</td>\n",
              "      <td>45</td>\n",
              "      <td>2000</td>\n",
              "      <td>Female</td>\n",
              "      <td>26</td>\n",
              "      <td>Asian-Pac-Islander</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Japan</td>\n",
              "      <td>Sales</td>\n",
              "      <td>Wife</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>2000</td>\n",
              "      <td>8</td>\n",
              "      <td>State-gov</td>\n",
              "      <td>250000</td>\n",
              "      <td>35</td>\n",
              "      <td>0</td>\n",
              "      <td>Male</td>\n",
              "      <td>53</td>\n",
              "      <td>Black</td>\n",
              "      <td>Divorced</td>\n",
              "      <td>11th</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Tech-support</td>\n",
              "      <td>Not-in-family</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>0</td>\n",
              "      <td>10</td>\n",
              "      <td>Private</td>\n",
              "      <td>260000</td>\n",
              "      <td>50</td>\n",
              "      <td>5000</td>\n",
              "      <td>Female</td>\n",
              "      <td>43</td>\n",
              "      <td>White</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Unmarried</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>1000</td>\n",
              "      <td>9</td>\n",
              "      <td>Self-emp-inc</td>\n",
              "      <td>270000</td>\n",
              "      <td>55</td>\n",
              "      <td>10000</td>\n",
              "      <td>Male</td>\n",
              "      <td>49</td>\n",
              "      <td>Asian-Pac-Islander</td>\n",
              "      <td>Separated</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Canada</td>\n",
              "      <td>Craft-repair</td>\n",
              "      <td>Own-child</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>500</td>\n",
              "      <td>13</td>\n",
              "      <td>Federal-gov</td>\n",
              "      <td>280000</td>\n",
              "      <td>60</td>\n",
              "      <td>3000</td>\n",
              "      <td>Female</td>\n",
              "      <td>36</td>\n",
              "      <td>White</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>Assoc-acdm</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Mexico</td>\n",
              "      <td>Adm-clerical</td>\n",
              "      <td>Unmarried</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>0</td>\n",
              "      <td>11</td>\n",
              "      <td>Private</td>\n",
              "      <td>290000</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Male</td>\n",
              "      <td>32</td>\n",
              "      <td>Black</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>Assoc-voc</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Protective-serv</td>\n",
              "      <td>Husband</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>1500</td>\n",
              "      <td>12</td>\n",
              "      <td>Private</td>\n",
              "      <td>300000</td>\n",
              "      <td>45</td>\n",
              "      <td>2000</td>\n",
              "      <td>Female</td>\n",
              "      <td>28</td>\n",
              "      <td>Asian-Pac-Islander</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Japan</td>\n",
              "      <td>Sales</td>\n",
              "      <td>Wife</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>2000</td>\n",
              "      <td>8</td>\n",
              "      <td>State-gov</td>\n",
              "      <td>310000</td>\n",
              "      <td>35</td>\n",
              "      <td>0</td>\n",
              "      <td>Male</td>\n",
              "      <td>54</td>\n",
              "      <td>Black</td>\n",
              "      <td>Divorced</td>\n",
              "      <td>11th</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Tech-support</td>\n",
              "      <td>Not-in-family</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>0</td>\n",
              "      <td>10</td>\n",
              "      <td>Private</td>\n",
              "      <td>320000</td>\n",
              "      <td>50</td>\n",
              "      <td>5000</td>\n",
              "      <td>Female</td>\n",
              "      <td>41</td>\n",
              "      <td>White</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Unmarried</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>1000</td>\n",
              "      <td>9</td>\n",
              "      <td>Self-emp-inc</td>\n",
              "      <td>330000</td>\n",
              "      <td>55</td>\n",
              "      <td>10000</td>\n",
              "      <td>Male</td>\n",
              "      <td>46</td>\n",
              "      <td>Asian-Pac-Islander</td>\n",
              "      <td>Separated</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Canada</td>\n",
              "      <td>Craft-repair</td>\n",
              "      <td>Own-child</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>500</td>\n",
              "      <td>13</td>\n",
              "      <td>Federal-gov</td>\n",
              "      <td>340000</td>\n",
              "      <td>60</td>\n",
              "      <td>3000</td>\n",
              "      <td>Female</td>\n",
              "      <td>38</td>\n",
              "      <td>Black</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>Assoc-acdm</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Mexico</td>\n",
              "      <td>Adm-clerical</td>\n",
              "      <td>Unmarried</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-8e4987c1-cf43-4e0c-b56b-2bc4d5948f3a')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-8e4987c1-cf43-4e0c-b56b-2bc4d5948f3a button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-8e4987c1-cf43-4e0c-b56b-2bc4d5948f3a');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "<div id=\"df-6ebb328d-171d-48bf-9667-bc14b4d3f1d2\">\n",
              "  <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-6ebb328d-171d-48bf-9667-bc14b4d3f1d2')\"\n",
              "            title=\"Suggest charts\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "     width=\"24px\">\n",
              "    <g>\n",
              "        <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
              "    </g>\n",
              "</svg>\n",
              "  </button>\n",
              "\n",
              "<style>\n",
              "  .colab-df-quickchart {\n",
              "      --bg-color: #E8F0FE;\n",
              "      --fill-color: #1967D2;\n",
              "      --hover-bg-color: #E2EBFA;\n",
              "      --hover-fill-color: #174EA6;\n",
              "      --disabled-fill-color: #AAA;\n",
              "      --disabled-bg-color: #DDD;\n",
              "  }\n",
              "\n",
              "  [theme=dark] .colab-df-quickchart {\n",
              "      --bg-color: #3B4455;\n",
              "      --fill-color: #D2E3FC;\n",
              "      --hover-bg-color: #434B5C;\n",
              "      --hover-fill-color: #FFFFFF;\n",
              "      --disabled-bg-color: #3B4455;\n",
              "      --disabled-fill-color: #666;\n",
              "  }\n",
              "\n",
              "  .colab-df-quickchart {\n",
              "    background-color: var(--bg-color);\n",
              "    border: none;\n",
              "    border-radius: 50%;\n",
              "    cursor: pointer;\n",
              "    display: none;\n",
              "    fill: var(--fill-color);\n",
              "    height: 32px;\n",
              "    padding: 0;\n",
              "    width: 32px;\n",
              "  }\n",
              "\n",
              "  .colab-df-quickchart:hover {\n",
              "    background-color: var(--hover-bg-color);\n",
              "    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "    fill: var(--button-hover-fill-color);\n",
              "  }\n",
              "\n",
              "  .colab-df-quickchart-complete:disabled,\n",
              "  .colab-df-quickchart-complete:disabled:hover {\n",
              "    background-color: var(--disabled-bg-color);\n",
              "    fill: var(--disabled-fill-color);\n",
              "    box-shadow: none;\n",
              "  }\n",
              "\n",
              "  .colab-df-spinner {\n",
              "    border: 2px solid var(--fill-color);\n",
              "    border-color: transparent;\n",
              "    border-bottom-color: var(--fill-color);\n",
              "    animation:\n",
              "      spin 1s steps(1) infinite;\n",
              "  }\n",
              "\n",
              "  @keyframes spin {\n",
              "    0% {\n",
              "      border-color: transparent;\n",
              "      border-bottom-color: var(--fill-color);\n",
              "      border-left-color: var(--fill-color);\n",
              "    }\n",
              "    20% {\n",
              "      border-color: transparent;\n",
              "      border-left-color: var(--fill-color);\n",
              "      border-top-color: var(--fill-color);\n",
              "    }\n",
              "    30% {\n",
              "      border-color: transparent;\n",
              "      border-left-color: var(--fill-color);\n",
              "      border-top-color: var(--fill-color);\n",
              "      border-right-color: var(--fill-color);\n",
              "    }\n",
              "    40% {\n",
              "      border-color: transparent;\n",
              "      border-right-color: var(--fill-color);\n",
              "      border-top-color: var(--fill-color);\n",
              "    }\n",
              "    60% {\n",
              "      border-color: transparent;\n",
              "      border-right-color: var(--fill-color);\n",
              "    }\n",
              "    80% {\n",
              "      border-color: transparent;\n",
              "      border-right-color: var(--fill-color);\n",
              "      border-bottom-color: var(--fill-color);\n",
              "    }\n",
              "    90% {\n",
              "      border-color: transparent;\n",
              "      border-bottom-color: var(--fill-color);\n",
              "    }\n",
              "  }\n",
              "</style>\n",
              "\n",
              "  <script>\n",
              "    async function quickchart(key) {\n",
              "      const quickchartButtonEl =\n",
              "        document.querySelector('#' + key + ' button');\n",
              "      quickchartButtonEl.disabled = true;  // To prevent multiple clicks.\n",
              "      quickchartButtonEl.classList.add('colab-df-spinner');\n",
              "      try {\n",
              "        const charts = await google.colab.kernel.invokeFunction(\n",
              "            'suggestCharts', [key], {});\n",
              "      } catch (error) {\n",
              "        console.error('Error during call to suggestCharts:', error);\n",
              "      }\n",
              "      quickchartButtonEl.classList.remove('colab-df-spinner');\n",
              "      quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
              "    }\n",
              "    (() => {\n",
              "      let quickchartButtonEl =\n",
              "        document.querySelector('#df-6ebb328d-171d-48bf-9667-bc14b4d3f1d2 button');\n",
              "      quickchartButtonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "    })();\n",
              "  </script>\n",
              "</div>\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "text/plain": [
              "   capital-loss educational-num         workclass  fnlwgt hours-per-week  \\\n",
              "0          1500              12           Private   50000             40   \n",
              "1             0              10  Self-emp-not-inc   60000             45   \n",
              "2          2000               8         State-gov   70000             35   \n",
              "3             0              14           Private   80000             50   \n",
              "4          1000               9      Self-emp-inc   90000             55   \n",
              "5           500              13       Federal-gov  100000             60   \n",
              "6             0              11           Private  110000             40   \n",
              "7          1500              12           Private  120000             45   \n",
              "8          2000               8         State-gov  130000             35   \n",
              "9             0              10           Private  140000             50   \n",
              "10         1000               9      Self-emp-inc  150000             55   \n",
              "11          500              13       Federal-gov  160000             60   \n",
              "12            0              11           Private  170000             40   \n",
              "13         1500              12           Private  180000             45   \n",
              "14         2000               8         State-gov  190000             35   \n",
              "15            0              10           Private  200000             50   \n",
              "16         1000               9      Self-emp-inc  210000             55   \n",
              "17          500              13       Federal-gov  220000             60   \n",
              "18            0              11           Private  230000             40   \n",
              "19         1500              12           Private  240000             45   \n",
              "20         2000               8         State-gov  250000             35   \n",
              "21            0              10           Private  260000             50   \n",
              "22         1000               9      Self-emp-inc  270000             55   \n",
              "23          500              13       Federal-gov  280000             60   \n",
              "24            0              11           Private  290000             40   \n",
              "25         1500              12           Private  300000             45   \n",
              "26         2000               8         State-gov  310000             35   \n",
              "27            0              10           Private  320000             50   \n",
              "28         1000               9      Self-emp-inc  330000             55   \n",
              "29          500              13       Federal-gov  340000             60   \n",
              "\n",
              "   capital-gain  gender age                race      marital-status  \\\n",
              "0          2000    Male  35               White  Married-civ-spouse   \n",
              "1             0  Female  28               Black       Never-married   \n",
              "2             0    Male  45  Asian-Pac-Islander            Divorced   \n",
              "3          5000  Female  40               White  Married-civ-spouse   \n",
              "4         10000    Male  50               Black           Separated   \n",
              "5          3000  Female  30               White       Never-married   \n",
              "6             0    Male  38               Black  Married-civ-spouse   \n",
              "7          2000  Female  25  Asian-Pac-Islander  Married-civ-spouse   \n",
              "8             0    Male  55               White            Divorced   \n",
              "9          5000  Female  42               Black       Never-married   \n",
              "10        10000    Male  48               White           Separated   \n",
              "11         3000  Female  32  Asian-Pac-Islander       Never-married   \n",
              "12            0    Male  36               Black  Married-civ-spouse   \n",
              "13         2000  Female  27               White  Married-civ-spouse   \n",
              "14            0    Male  52               Black            Divorced   \n",
              "15         5000  Female  44  Asian-Pac-Islander       Never-married   \n",
              "16        10000    Male  47               White           Separated   \n",
              "17         3000  Female  34               Black       Never-married   \n",
              "18            0    Male  34               White  Married-civ-spouse   \n",
              "19         2000  Female  26  Asian-Pac-Islander  Married-civ-spouse   \n",
              "20            0    Male  53               Black            Divorced   \n",
              "21         5000  Female  43               White       Never-married   \n",
              "22        10000    Male  49  Asian-Pac-Islander           Separated   \n",
              "23         3000  Female  36               White       Never-married   \n",
              "24            0    Male  32               Black  Married-civ-spouse   \n",
              "25         2000  Female  28  Asian-Pac-Islander  Married-civ-spouse   \n",
              "26            0    Male  54               Black            Divorced   \n",
              "27         5000  Female  41               White       Never-married   \n",
              "28        10000    Male  46  Asian-Pac-Islander           Separated   \n",
              "29         3000  Female  38               Black       Never-married   \n",
              "\n",
              "       education income native-country       occupation   relationship  \n",
              "0      Bachelors   >50K  United-States            Sales        Husband  \n",
              "1        HS-grad  <=50K  United-States     Tech-support  Not-in-family  \n",
              "2           11th  <=50K          China  Exec-managerial      Unmarried  \n",
              "3        Masters   >50K         Canada   Prof-specialty           Wife  \n",
              "4   Some-college  <=50K         Mexico     Craft-repair      Own-child  \n",
              "5     Assoc-acdm  <=50K  United-States     Adm-clerical      Unmarried  \n",
              "6      Assoc-voc   >50K  United-States  Protective-serv        Husband  \n",
              "7      Bachelors   >50K          Japan            Sales           Wife  \n",
              "8           11th  <=50K  United-States     Tech-support  Not-in-family  \n",
              "9        HS-grad  <=50K  United-States  Exec-managerial      Unmarried  \n",
              "10  Some-college  <=50K         Canada     Craft-repair      Own-child  \n",
              "11    Assoc-acdm  <=50K         Mexico     Adm-clerical      Unmarried  \n",
              "12     Assoc-voc   >50K  United-States  Protective-serv        Husband  \n",
              "13     Bachelors   >50K          Japan            Sales           Wife  \n",
              "14          11th  <=50K  United-States     Tech-support  Not-in-family  \n",
              "15       HS-grad  <=50K  United-States  Exec-managerial      Unmarried  \n",
              "16  Some-college  <=50K         Canada     Craft-repair      Own-child  \n",
              "17    Assoc-acdm  <=50K         Mexico     Adm-clerical      Unmarried  \n",
              "18     Assoc-voc   >50K  United-States  Protective-serv        Husband  \n",
              "19     Bachelors   >50K          Japan            Sales           Wife  \n",
              "20          11th  <=50K  United-States     Tech-support  Not-in-family  \n",
              "21       HS-grad  <=50K  United-States  Exec-managerial      Unmarried  \n",
              "22  Some-college  <=50K         Canada     Craft-repair      Own-child  \n",
              "23    Assoc-acdm  <=50K         Mexico     Adm-clerical      Unmarried  \n",
              "24     Assoc-voc   >50K  United-States  Protective-serv        Husband  \n",
              "25     Bachelors   >50K          Japan            Sales           Wife  \n",
              "26          11th  <=50K  United-States     Tech-support  Not-in-family  \n",
              "27       HS-grad  <=50K  United-States  Exec-managerial      Unmarried  \n",
              "28  Some-college  <=50K         Canada     Craft-repair      Own-child  \n",
              "29    Assoc-acdm  <=50K         Mexico     Adm-clerical      Unmarried  "
            ]
          },
          "execution_count": 5,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "model.fit(metadata)\n",
        "# this may take a while\n",
        "model.sample(30, off_table_features = ['has_car'])"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "3rFdzkvarCkN"
      },
      "source": [
        "View the original information returned by gpt through the `_responses` attribute."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "o_22u0O5Vnor",
        "outputId": "aeb88f48-f389-47e0-ad89-60182836be03"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "[ChatCompletion(id='chatcmpl-8woAFkiUjRull9O1T1Tsgc8mAFcWN', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='capital-loss is 1500, educational-num is 12, workclass is Private, fnlwgt is 50000, hours-per-week is 40, capital-gain is 2000, gender is Male, age is 35, race is White, marital-status is Married-civ-spouse, education is Bachelors, income is >50K, native-country is United-States, occupation is Sales, relationship is Husband\\ncapital-loss is 0, educational-num is 10, workclass is Self-emp-not-inc, fnlwgt is 60000, hours-per-week is 45, capital-gain is 0, gender is Female, age is 28, race is Black, marital-status is Never-married, education is HS-grad, income is <=50K, native-country is United-States, occupation is Tech-support, relationship is Not-in-family\\ncapital-loss is 2000, educational-num is 8, workclass is State-gov, fnlwgt is 70000, hours-per-week is 35, capital-gain is 0, gender is Male, age is 45, race is Asian-Pac-Islander, marital-status is Divorced, education is 11th, income is <=50K, native-country is China, occupation is Exec-managerial, relationship is Unmarried\\ncapital-loss is 0, educational-num is 14, workclass is Private, fnlwgt is 80000, hours-per-week is 50, capital-gain is 5000, gender is Female, age is 40, race is White, marital-status is Married-civ-spouse, education is Masters, income is >50K, native-country is Canada, occupation is Prof-specialty, relationship is Wife\\ncapital-loss is 1000, educational-num is 9, workclass is Self-emp-inc, fnlwgt is 90000, hours-per-week is 55, capital-gain is 10000, gender is Male, age is 50, race is Black, marital-status is Separated, education is Some-college, income is <=50K, native-country is Mexico, occupation is Craft-repair, relationship is Own-child\\ncapital-loss is 500, educational-num is 13, workclass is Federal-gov, fnlwgt is 100000, hours-per-week is 60, capital-gain is 3000, gender is Female, age is 30, race is White, marital-status is Never-married, education is Assoc-acdm, income is <=50K, native-country is United-States, occupation is Adm-clerical, relationship is Unmarried\\ncapital-loss is 0, educational-num is 11, workclass is Private, fnlwgt is 110000, hours-per-week is 40, capital-gain is 0, gender is Male, age is 38, race is Black, marital-status is Married-civ-spouse, education is Assoc-voc, income is >50K, native-country is United-States, occupation is Protective-serv, relationship is Husband\\ncapital-loss is 1500, educational-num is 12, workclass is Private, fnlwgt is 120000, hours-per-week is 45, capital-gain is 2000, gender is Female, age is 25, race is Asian-Pac-Islander, marital-status is Married-civ-spouse, education is Bachelors, income is >50K, native-country is Japan, occupation is Sales, relationship is Wife\\ncapital-loss is 2000, educational-num is 8, workclass is State-gov, fnlwgt is 130000, hours-per-week is 35, capital-gain is 0, gender is Male, age is 55, race is White, marital-status is Divorced, education is 11th, income is <=50K, native-country is United-States, occupation is Tech-support, relationship is Not-in-family\\ncapital-loss is 0, educational-num is 10, workclass is Private, fnlwgt is 140000, hours-per-week is 50, capital-gain is 5000, gender is Female, age is 42, race is Black, marital-status is Never-married, education is HS-grad, income is <=50K, native-country is United-States, occupation is Exec-managerial, relationship is Unmarried\\ncapital-loss is 1000, educational-num is 9, workclass is Self-emp-inc, fnlwgt is 150000, hours-per-week is 55, capital-gain is 10000, gender is Male, age is 48, race is White, marital-status is Separated, education is Some-college, income is <=50K, native-country is Canada, occupation is Craft-repair, relationship is Own-child\\ncapital-loss is 500, educational-num is 13, workclass is Federal-gov, fnlwgt is 160000, hours-per-week is 60, capital-gain is 3000, gender is Female, age is 32, race is Asian-Pac-Islander, marital-status is Never-married, education is Assoc-acdm, income is <=50K, native-country is Mexico, occupation is Adm-clerical, relationship is Unmarried\\ncapital-loss is 0, educational-num is 11, workclass is Private, fnlwgt is 170000, hours-per-week is 40, capital-gain is 0, gender is Male, age is 36, race is Black, marital-status is Married-civ-spouse, education is Assoc-voc, income is >50K, native-country is United-States, occupation is Protective-serv, relationship is Husband\\ncapital-loss is 1500, educational-num is 12, workclass is Private, fnlwgt is 180000, hours-per-week is 45, capital-gain is 2000, gender is Female, age is 27, race is White, marital-status is Married-civ-spouse, education is Bachelors, income is >50K, native-country is Japan, occupation is Sales, relationship is Wife\\ncapital-loss is 2000, educational-num is 8, workclass is State-gov, fnlwgt is 190000, hours-per-week is 35, capital-gain is 0, gender is Male, age is 52, race is Black, marital-status is Divorced, education is 11th, income is <=50K, native-country is United-States, occupation is Tech-support, relationship is Not-in-family\\ncapital-loss is 0, educational-num is 10, workclass is Private, fnlwgt is 200000, hours-per-week is 50, capital-gain is 5000, gender is Female, age is 44, race is Asian-Pac-Islander, marital-status is Never-married, education is HS-grad, income is <=50K, native-country is United-States, occupation is Exec-managerial, relationship is Unmarried\\ncapital-loss is 1000, educational-num is 9, workclass is Self-emp-inc, fnlwgt is 210000, hours-per-week is 55, capital-gain is 10000, gender is Male, age is 47, race is White, marital-status is Separated, education is Some-college, income is <=50K, native-country is Canada, occupation is Craft-repair, relationship is Own-child\\ncapital-loss is 500, educational-num is 13, workclass is Federal-gov, fnlwgt is 220000, hours-per-week is 60, capital-gain is 3000, gender is Female, age is 34, race is Black, marital-status is Never-married, education is Assoc-acdm, income is <=50K, native-country is Mexico, occupation is Adm-clerical, relationship is Unmarried\\ncapital-loss is 0, educational-num is 11, workclass is Private, fnlwgt is 230000, hours-per-week is 40, capital-gain is 0, gender is Male, age is 34, race is White, marital-status is Married-civ-spouse, education is Assoc-voc, income is >50K, native-country is United-States, occupation is Protective-serv, relationship is Husband\\ncapital-loss is 1500, educational-num is 12, workclass is Private, fnlwgt is 240000, hours-per-week is 45, capital-gain is 2000, gender is Female, age is 26, race is Asian-Pac-Islander, marital-status is Married-civ-spouse, education is Bachelors, income is >50K, native-country is Japan, occupation is Sales, relationship is Wife\\ncapital-loss is 2000, educational-num is 8, workclass is State-gov, fnlwgt is 250000, hours-per-week is 35, capital-gain is 0, gender is Male, age is 53, race is Black, marital-status is Divorced, education is 11th, income is <=50K, native-country is United-States, occupation is Tech-support, relationship is Not-in-family\\ncapital-loss is 0, educational-num is 10, workclass is Private, fnlwgt is 260000, hours-per-week is 50, capital-gain is 5000, gender is Female, age is 43, race is White, marital-status is Never-married, education is HS-grad, income is <=50K, native-country is United-States, occupation is Exec-managerial, relationship is Unmarried\\ncapital-loss is 1000, educational-num is 9, workclass is Self-emp-inc, fnlwgt is 270000, hours-per-week is 55, capital-gain is 10000, gender is Male, age is 49, race is Asian-Pac-Islander, marital-status is Separated, education is Some-college, income is <=50K, native-country is Canada, occupation is Craft-repair, relationship is Own-child\\ncapital-loss is 500, educational-num is 13, workclass is Federal-gov, fnlwgt is 280000, hours-per-week is 60, capital-gain is 3000, gender is Female, age is 36, race is White, marital-status is Never-married, education is Assoc-acdm, income is <=50K, native-country is Mexico, occupation is Adm-clerical, relationship is Unmarried\\ncapital-loss is 0, educational-num is 11, workclass is Private, fnlwgt is 290000, hours-per-week is 40, capital-gain is 0, gender is Male, age is 32, race is Black, marital-status is Married-civ-spouse, education is Assoc-voc, income is >50K, native-country is United-States, occupation is Protective-serv, relationship is Husband\\ncapital-loss is 1500, educational-num is 12, workclass is Private, fnlwgt is 300000, hours-per-week is 45, capital-gain is 2000, gender is Female, age is 28, race is Asian-Pac-Islander, marital-status is Married-civ-spouse, education is Bachelors, income is >50K, native-country is Japan, occupation is Sales, relationship is Wife\\ncapital-loss is 2000, educational-num is 8, workclass is State-gov, fnlwgt is 310000, hours-per-week is 35, capital-gain is 0, gender is Male, age is 54, race is Black, marital-status is Divorced, education is 11th, income is <=50K, native-country is United-States, occupation is Tech-support, relationship is Not-in-family\\ncapital-loss is 0, educational-num is 10, workclass is Private, fnlwgt is 320000, hours-per-week is 50, capital-gain is 5000, gender is Female, age is 41, race is White, marital-status is Never-married, education is HS-grad, income is <=50K, native-country is United-States, occupation is Exec-managerial, relationship is Unmarried\\ncapital-loss is 1000, educational-num is 9, workclass is Self-emp-inc, fnlwgt is 330000, hours-per-week is 55, capital-gain is 10000, gender is Male, age is 46, race is Asian-Pac-Islander, marital-status is Separated, education is Some-college, income is <=50K, native-country is Canada, occupation is Craft-repair, relationship is Own-child\\ncapital-loss is 500, educational-num is 13, workclass is Federal-gov, fnlwgt is 340000, hours-per-week is 60, capital-gain is 3000, gender is Female, age is 38, race is Black, marital-status is Never-married, education is Assoc-acdm, income is <=50K, native-country is Mexico, occupation is Adm-clerical, relationship is Unmarried', role='assistant', function_call=None, tool_calls=None))], created=1709026547, model='gpt-3.5-turbo-0125', object='chat.completion', system_fingerprint='fp_86156a94a0', usage=CompletionUsage(completion_tokens=2756, prompt_tokens=269, total_tokens=3025))]"
            ]
          },
          "execution_count": 7,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "model._responses"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
